package com.fz.song;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.util.unit.DataSize;

import javax.servlet.MultipartConfigElement;

@SpringBootApplication
@MapperScan(value = "com.fz.song.mapper")
public class BigfileuploadApplication {

    public static void main(String[] args) {
        SpringApplication.run(BigfileuploadApplication.class, args);
    }

    @Bean
    public MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory config = new MultipartConfigFactory();
        DataSize dataSize = DataSize.ofBytes(1024 * 1024 * 500);
        config.setMaxFileSize(dataSize);
        config.setMaxRequestSize(dataSize);
        return config.createMultipartConfig();
    }



}

